home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8828 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: minerva.ibernet.es!usenet
  2. From: cmahoney@readysoft.es (Colin Mahoney)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q: implementing streambuf::underflow() method
  5. Date: Mon, 26 Feb 1996 21:44:48 GMT
  6. Organization: Servicio IBERNET (Telefonica Transmision de Datos)
  7. Message-ID: <31318fb6.3582660@news.ibernet.es>
  8. References: <4gij8m$pi7@news.xs4all.nl>
  9. NNTP-Posting-Host: readysoft_203.readysoft.es
  10. X-Newsreader: Forte Agent .99d/32.182
  11.  
  12. Ronald Werring <ronaldw@xs4all.nl> wrote:
  13.  
  14. >I want to make a subclass of the streambuf class to
  15. >implement a different buffering strategy for an istream.
  16. >I use Visual-C++ (1.5 and 4.0).
  17. >
  18. >My question: "When is underflow() called? Only when
  19. >              the buffer is empty or for every character?"
  20. >
  21.  
  22. underflow should be called only when the buffer is empty. To find out
  23. if this is indeed what happens, set a breakpoint on 'return *gptr()' (
  24. after moving it to a new line, of course - one reason not to have
  25. multiple statements on the same line ), and one on one of the
  26. following lines. Then let it run and see for yourself.  
  27.  
  28.  
  29. [...]
  30. ---------------------------------------
  31. Colin Mahoney ( cmahoney@readysoft.es )
  32. Sabadell, Spain
  33. ---------------------------------------
  34.